package com.liang.response.core;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.liang.response.domain.Detail;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liangyehao
 * @version 1.0
 * @date 2021/4/24 0:16
 * @content
 */
public class DataListener extends AnalysisEventListener<Detail> {
    private List<Detail> list = new ArrayList<>();
    @Override
    public void invoke(Detail originData, AnalysisContext analysisContext) {
        list.add(originData);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        //System.out.println(list.get(0));
    }

    public List<Detail> getList() {
        return list;
    }
}
